import { useWindowSize } from '@vueuse/core'
import { useUserSettings } from '@/store/useUserSettings'

export default () => {
	const { width: windowWidth } = useWindowSize()
	const { isCollapsedSidebar } = storeToRefs(useUserSettings())
	watch(windowWidth, width => {
		isCollapsedSidebar.value = width <= 1000
	})
	return {
		/** 是否折叠侧边栏 */
		isCollapsedSidebar
	}
}
